#ifndef __DLT645_MAIN_H__
#define __DLT645_MAIN_H__

#include "IModule.h"
#include "../../common/include/IChannel.h"
#include "Dlt645MessageManager.h"
#include "../../common/include/CConfigManager.h"
#include "../../serialProxy/include/SerialProxy.h"
#include "../../common/include/CMosquittoManager.h"


#ifdef __cplusplus
extern "C"{
#endif

/**
* @brief Get the module name object
*
* @return char*
*/
extern char *get_module_name();


/**
* @brief 处理DL/T645业务逻辑
*
* @param pcm           - 配置信息
* @param psp           - 串口代理(同步处理串口请求与接收)
* @param pmm           - mqtt通信对象指针
* @param ptask          - 设备包含的请求信息请求信息
* @return int
*/
extern int run(std::shared_ptr<CConfigManager> pcm, std::shared_ptr<IChannel> channel_ptr,
        std::shared_ptr<CMosquittoManager> pmm, 
        IModule &im,
        std::shared_ptr<TASK_PARAMS> ptask);

extern int packet_parent_frame(std::shared_ptr<CConfigManager> cm,  
                                std::shared_ptr<TERMINAL_DEVICE> pdev, 
                                uint8_t *data, int &len);
extern int parse_parent_frame(std::shared_ptr<CConfigManager> cm, uint8_t *data, int &len);

#ifdef __cplusplus
}
#endif

#endif